using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

namespace CUSTOMS.Modules.QLHS.Components.QLBB
{
    public partial class HangHoa
    {
        public static DataSet SelectBy_ToKhai(int soToKhai, string maHaiQuan, string maLoaiHinh, int namDangKy)
        {
            const string spName = "[dbo].[p_HAIQUAN_QLHS_HangHoa_SelectBy_ToKhai]";
            SqlDatabase db = (SqlDatabase)DatabaseFactory.CreateDatabase();
            SqlCommand dbCommand = (SqlCommand)db.GetStoredProcCommand(spName);

            db.AddInParameter(dbCommand, "@SoToKhai", SqlDbType.Int, soToKhai);
            db.AddInParameter(dbCommand, "@MaHaiQuan", SqlDbType.Char, maHaiQuan);
            db.AddInParameter(dbCommand, "@MaLoaiHinh", SqlDbType.Char, maLoaiHinh);
            db.AddInParameter(dbCommand, "@NamDangKy", SqlDbType.Int, namDangKy);

            return db.ExecuteDataSet(dbCommand);
        }
    }
}
